Show AllShow All

LOOKUP

See Also

The LOOKUP function has two syntax forms: vector and array.

The array form of LOOKUP looks in the first row or column of an array for the specified value and returns a value from the same position in the last row or column of the array. Use this form of LOOKUP when the values you want to match are in the first row or column of the array. Use the other form of LOOKUP when you want to specify the location of the column or row.

ShowTip

Syntax 2

Array form

LOOKUP(lookup_value,array)

Lookup_value    is a value that LOOKUP searches for in an array. Lookup_value can be a number, text, a logical value, or a name or reference that refers to a value.

Array    is a range of cells that contains text, numbers, or logical values that you want to compare with lookup_value.

The array form of LOOKUP is very similar to the HLOOKUP and VLOOKUP functions. The difference is that HLOOKUP searches for lookup_value in the first row, VLOOKUP searches in the first column, and LOOKUP searches according to the dimensions of array.

Important  The values in array must be placed in ascending order: ...,-2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise, LOOKUP may not give the correct value. Uppercase and lowercase text are equivalent.

Example

The example may be easier to understand if you copy it to a blank worksheet.

Show How?

 
1
2
3
A B
Formula Description (Result)
=LOOKUP("C",{"a","b","c","d";1,2,3,4}) Looks up "C" in first row of the array and returns the value in the last row that's in the same column (3)
=LOOKUP("bump",{"a",1;"b",2;"c",3}) Looks up "bump" in first row of the array and returns the value in the last column that's in the same row (2)